﻿<Window x:Class="Big3.Hitbase.CDUtilities.WindowBrowseCDArchive"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:misc="clr-namespace:Big3.Hitbase.Miscellaneous;assembly=Misc"
        Title="CD-Archiv durchsuchen" Height="600" Width="700" MinHeight="500" MinWidth="700" Style="{DynamicResource MyWindowStyle}"
        ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
        TextOptions.TextFormattingMode="Display" Loaded="Window_Loaded" Closing="Window_Closing"  >
    <Window.Resources>
        <misc:LengthConverter x:Key="lengthConverter" />
    </Window.Resources>
    <Grid Margin="10,20,10,10">
        <TextBlock Text="Hiermit können Sie das folgende CD-Archiv nach CD-Informationen durchsuchen und die Daten in Ihren Katalog übertragen." TextWrapping="Wrap" VerticalAlignment="Top"/>
        <TextBlock Text="CD-Archiv:" Margin="0,40"/>
        <ComboBox Name="ComboBoxCDArchives" Margin="80,38" VerticalAlignment="Top" HorizontalAlignment="Left" Width="200" />
       
        
        <GroupBox VerticalAlignment="Top" Margin="0,70,150,0" Header="Suche nach CDs, auf die folgende Kriterien zutreffen:" Padding="10" >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <TextBlock Grid.Column="0" Grid.Row="0" Text="Interpret:" VerticalAlignment="Center" Margin="0,0,20,0" />
                <TextBlock Grid.Column="0" Grid.Row="1" Text="Titel:"  VerticalAlignment="Center" Margin="0,0,20,0"  />
                <TextBlock Grid.Column="0" Grid.Row="2" Text="UPC/EAN:" VerticalAlignment="Center" Margin="0,0,20,0" />
                <TextBox Name="TextBoxArtist" Grid.Column="1" Grid.Row="0" Margin="5,5,20,5" TextChanged="TextBoxArtist_TextChanged" />
                <TextBox Name="TextBoxTitle" Grid.Column="1" Grid.Row="1" Margin="5,5,20,5" TextChanged="TextBoxTitle_TextChanged" />
                <TextBox Name="TextBoxUPC" Grid.Column="1" Grid.Row="2" Margin="5,5,20,5" TextChanged="TextBoxUPC_TextChanged" />
                <TextBlock Grid.Column="2" Grid.Row="0" Text="Anzahl Tracks:" VerticalAlignment="Center" />
                <TextBox Name="TextBoxNumberOfTracks" Grid.Column="3" Grid.Row="0" Margin="5" Width="50" HorizontalAlignment="Left"/>
                <Button Name="ButtonSearch" Content="Suche starten" Margin="0,0,0,0" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Left"  Padding="15,2,15,2" VerticalAlignment="Center" Click="ButtonSearch_Click" IsDefault="True" />
                <ProgressBar Grid.Column="3" Grid.Row="1" Height="20" HorizontalAlignment="Left" Margin="0,0,0,0" Name="progressBarSearch" IsIndeterminate="True" VerticalAlignment="Center" Width="106" Visibility="Collapsed" />
            </Grid>
        </GroupBox>
        <TextBlock Name="TextBlockStatus" Margin="0,220,0,0" VerticalAlignment="Top" />
        <DataGrid AutoGenerateColumns="False" Margin="0,240,0,80" Name="DataGridResult" SelectionChanged="DataGridResult_SelectionChanged"
            CanUserAddRows="false" CanUserDeleteRows="false" Background="Transparent" MouseDoubleClick="DataGridResult_MouseDoubleClick"
            CanUserSortColumns="False" CanUserResizeRows="False" IsReadOnly="True"
            BorderThickness="0" HeadersVisibility="Column" RowHeaderWidth="0" SelectionUnit="FullRow" EnableRowVirtualization="True" EnableColumnVirtualization="False" >
            <DataGrid.Columns>
                <DataGridTextColumn Header="Interpret" Width="250" Binding="{Binding Artist}" />
                <DataGridTextColumn Header="Titel" Width="250" Binding="{Binding Title}" />
                <DataGridTextColumn Header="Länge" Width="50" Binding="{Binding Length, Converter={StaticResource lengthConverter}}" />
                <DataGridTextColumn Header="Tracks" Width="50" Binding="{Binding NumberOfTracks}" />
            </DataGrid.Columns>
            
        </DataGrid>

        <Button Name="ButtonShowDetails" Content="Details anzeigen..." VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,0,50"  Padding="5,2,5,2" Click="ButtonShowDetails_Click" />

        <Rectangle VerticalAlignment="Bottom" Height="2" Margin="0,0,0,35" Fill="LightGray" />
        
        <Button Name="ButtonImportCDs" Content="CD(s) übernehmen" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0,0,90,0" Padding="5,2,5,2" Click="ButtonImportCDs_Click" />
        <Button Name="ButtonClose" Content="Schließen" VerticalAlignment="Bottom" HorizontalAlignment="Right" Padding="10,2,10,2" IsCancel="True" Click="ButtonClose_Click" />
    </Grid>
</Window>
